function VDRResto()
	if not IsAddOnLoaded("PQInterface") then
		if not VSIWarning then
			VAS_WriteToChat("\124cFFFF55FFWarning: only works with VSI addon!")
			VSIWarning = true
		end
		return true
	end

	if not PQI_General_Resto_Druid_GUI_Loaded then
		local config = {
			name	= 'General Resto Druid',
			author	= 'Vachiusa',
			abilities = {
				-- General --
				{	name = "Auto Open PQI Options",
					tooltip = "Auto Opens PQI Options for you, will only happen once per login.",
					enable = true,
				},
				{	name = "54 Events",
					tooltip = "Enables the use of 5.4 boss specific mechanics",
					enable = true,
				},				
				{	name = "53 Events",
					tooltip = "Enables the use of 5.3 boss specific mechanics",
					enable = false,
				},
				{ 	name = "4x Events",
					enable = false,
					tooltip = "Enables the use of 4.x boss specific mechanics",
				},
				{ 	name = "Special Events",
					enable = false,
					tooltip = "Enables the use of special events mechanics (Providing Ground...)",
				},	
				{ 	name = "Auto Event Dispel",
					enable = true,
					tooltip = "Enables the use of dispel on special events mechanics",
				},								
				{ 	name = "Queue Sys",
					enable = true,
					tooltip = "Enables the use of auto dispel for Queue System",
				},					
				{ 	name = "Auto Target",
					enable = true,
					tooltip = "If you dont have a target it will target your focus target",
				},
				{ 	name = "Innervate",	
					enable = true,
					tooltip = "Enables the use of Innervate",
					widget = { type = 'numBox',
						value = 80,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of Mana to use Innervate at",
					},
				},
				{ 	name = "Symbiosis",
					enable = true,
					tooltip = "Enables the use of Symbiosis on friendly target",
				},				
				{ 	name = "DPS",
					enable = false,
					tooltip = "Enables DPS",
					widget = { type = 'numBox',
						value = 90,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of minimum raid members HP to DPS at",
					},
				},
				{ 	name = "Natures Cure",
					enable = true,
					tooltip = "Enables the use of Natures Cure",
					widget = { type = 'numBox',
						value = 50,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Natures Cure at",
					},
				},
				{ 	name = "Low Mana",	
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The minimum percent of Mana to not use some high mana skills at",
					},
				},				
				{ 	name = "Racials",
					enable = true,
					tooltip = "Enables the use of Racials",
				},								
				{ 	name = "Target Heal",
					enable = false,
					tooltip = "Enables the use of Target Heal priority",
				},											
				{ 	name = "Mouseover Heal",
					enable = false,
					tooltip = "Enables the use of Mouseover Heal priority",
				},		
				{ 	name = "NPC Mouseover Heal",
					enable = false,
					tooltip = "Enables the use of NPC Mouseover Heal priority",
				},	
				{ 	name = "Pet Heal",
					enable = true,
					tooltip = "Enables the use of Pet Heal",
				},			
				{ 	name = "Stop Casting",
					enable = true,
					tooltip = "Enables the use of Stop Casting",
				},												
				{ 	name = "V debug",
					enable = false,
					tooltip = "Enables the use of Vachiusa debug",
				},						
			},
			hotkeys = {
			},
		}
		PQI_General_Resto_Druid_GUI_Loaded = PQI:AddRotation(config)
	end

	if not PQI_CD_Resto_Druid_GUI_Loaded then
		local config = {
			name	= 'CD Resto Druid',
			author	= 'Vachiusa',
			abilities = {									
				-- CD's --
				{ 	name = "Ironbark",
					enable = true,
					tooltip = "Enables the use of Ironbark",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Ironbark at",
					},
				},
				{ 	name = "Nature Swiftness",
					enable = false,
					tooltip = "Enables the use of Nature Swiftness",
					widget = { type = 'numBox',
						value = 40,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Nature Swiftness at",
					},
				},
				{ 	name = "Spirit Walker Grace",
					enable = true,
					tooltip = "Enables the use of Spirit Walker Grace",
					widget = { type = 'numBox',
						value = 40,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Spirit Walker Grace at",
					},
				},
				{ 	name = "Talent 90",
					enable = true,
					tooltip = "Enables the use of Talent 90",
					widget = { type = 'numBox',
						value = 60,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Talent 90 at",
					},
				},				
				{ 	name = "Talent 90 Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 4,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of low HP raid members to use Talent 90 at",
					},
				},
				{ 	name = "Incarnation",
					enable = true,
					tooltip = "Enables the use of Incarnation",
					widget = { type = 'numBox',
						value = 60,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Incarnation at",
					},
				},				
				{ 	name = "Incarnation Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 4,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of low HP raid members to use Incarnation at",
					},
				},	
				{ 	name = "Force Of Nature",
					enable = true,
					tooltip = "Enables the use of Force Of Nature",
					widget = { type = 'numBox',
						value = 80,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Force Of Nature at",
					},
				},				
				{ 	name = "Force Of Nature Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 2,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of low HP raid members around healing target to use ForceOfNature at",
					},
				},		
				{ 	name = "Genesis",
					enable = true,
					tooltip = "Enables the use of Genesis",
					widget = { type = 'numBox',
						value = 85,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Genesis at",
					},
				},				
				{ 	name = "Genesis Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 3,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of low HP raid members to use Genesis at",
					},
				},	
				{ 	name = "Genesis Count",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 3,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of low HP raid members with Reju to use Genesis at",
					},
				},					
				{ 	name = "Tranquility",
					enable = true,
					tooltip = "Enables the use of Tranquility",
					widget = { type = 'numBox',
						value = 60,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Tranquility at",
					},
				},				
				{ 	name = "Tranquility Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 4,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of low HP raid members to use Tranquility at",
					},
				},								
			},
			hotkeys = {
			},
		}
		PQI_CD_Resto_Druid_GUI_Loaded = PQI:AddRotation(config)
	end

	if not PQI_Healing_Resto_Druid_GUI_Loaded then
		local config = {
			name	= 'Healing Resto Druid',
			author	= 'Vachiusa',
			abilities = {												
				-- Healing --
				{ 	name = "Healing Touch",
					enable = true,
					tooltip = "Enables the use of Healing Touch",
					widget = { type = 'numBox',
						value = 60,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Healing Touch at",
					},
				},
				{ 	name = "Omen Healing Touch",
					enable = true,
					tooltip = "Enables the use of Omen + Healing Touch",
					widget = { type = 'numBox',
						value = 80,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Omen + Healing Touch at",
					},
				},
				{ 	name = "Nourish",
					enable = true,
					tooltip = "Enables the use of Nourish",
					widget = { type = 'numBox',
						value = 80,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Nourish at",
					},
				},	
				{ 	name = "Lifebloom Focus",
					enable = false,
					tooltip = "Enables only use Lifebloom on focus target",
				},					
				{ 	name = "Regrowth",
					enable = true,
					tooltip = "Enables the use of Regrowth",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Regrowth at",
					},
				},	
				{ 	name = "Omen Regrowth",
					enable = true,
					tooltip = "Enables the use of Omen + Regrowth",
					widget = { type = 'numBox',
						value = 75,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Omen + Regrowth at",
					},
				},	
				{ 	name = "Rejuvenation",
					enable = true,
					tooltip = "Enables the use of Rejuvenation",
					widget = { type = 'numBox',
						value = 90,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Rejuvenation at",
					},
				},	
				{ 	name = "Rejuvenation Tank",
					enable = true,
					tooltip = "Enables the use of Rejuvenation on Tanks",
					widget = { type = 'numBox',
						value = 99,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Rejuvenation on Tanks at",
					},
				},	
				{ 	name = "Regrowth Tank",
					enable = true,
					tooltip = "Enables the use of Regrowth on Tanks",
					widget = { type = 'numBox',
						value = 30,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Regrowth on Tanks at",
					},
				},		
				{ 	name = "Swiftmend",
					enable = true,
					tooltip = "Enables the use of Swiftmend",
					widget = { type = 'numBox',
						value = 85,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Swiftmend at",
					},
				},				
				{ 	name = "Swiftmend Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 2,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of low HP raid members around healing target to use Swiftmend at",
					},
				},	
				{ 	name = "Wild Mushroom",
					enable = true,
					tooltip = "Enables the use of Wild Mushroom (Glyph of Efflorescence)",
					widget = { type = 'numBox',
						value = 85,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Wild Mushroom (Glyph of Efflorescence) at",
					},
				},				
				{ 	name = "Wild Mushroom Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 2,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of low HP raid members around healing target to use Wild Mushroom (Glyph of Efflorescence) at",
					},
				},									
				{ 	name = "Wild Growth",
					enable = true,
					tooltip = "Enables the use of Wild Growth",
					widget = { type = 'numBox',
						value = 85,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Wild Growth at",
					},
				},				
				{ 	name = "Wild Growth Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 3,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of low HP raid members around healing target to use Wild Growth at",
					},
				},					
			},
			hotkeys = {
				{	name = "Pause Rotation",			enable = true,	hotkeys = {'ls'},	},
				{	name = "Talent 60",					enable = true,	hotkeys = {'rs'},	
					tooltip = "Pop Talent 60", },
				{	name = "Genesis Mod",					enable = true,	hotkeys = {'lc'},
					tooltip = "Use Genesis", },
				{	name = "Wild Mushroom Bloom",		enable = true,	hotkeys = {'ra'},	
					tooltip = "Use Wild Mushroom Bloom", },
				{	name = "Tranquility",				enable = true,	hotkeys = {'rc'},	
					tooltip = "Pop Tranquility", },	
				{	name = "Talent 90",					enable = true,	hotkeys = {'ls', 'ra'},	
					tooltip = "Pop Talent 90", },						
				{	name	= "Adding Players CT",		enable	= true,	hotkeys	= {'ls', 'la'},
					tooltip = "Adding Players to Custom Table", },	
				{	name	= "Removing Players CT",	enable	= true,	hotkeys	= {'ls', 'lc'},
					tooltip = "Removing Players from Custom Table", },						
			},
		}
		PQI_Healing_Resto_Druid_GUI_Loaded = PQI:AddRotation(config)
	end
	if VaSpec ~= 105 then
		PQR_RotationChanged("Vachiusa Resto Druid")
		VaSpec = 105
	end

	-- Variables
	if PQI_General_Resto_Druid_GUI_Loaded and PQI_CD_Resto_Druid_GUI_Loaded and PQI_Healing_Resto_Druid_GUI_Loaded then
		PQI_Variables_Loaded = PQI_VachiusaGeneralRestoDruid_AutoOpenPQIOptions_enable
		VachiusaRestoDruid_AutoOpenPQIOptions_enable = PQI_VachiusaGeneralRestoDruid_AutoOpenPQIOptions_enable

		Vasa_HealingTouchCheck = PQI_VachiusaHealingRestoDruid_HealingTouch_enable
		Vasa_HealingTouch = PQI_VachiusaHealingRestoDruid_HealingTouch_value
		Vasa_OmenHealingTouchCheck = PQI_VachiusaHealingRestoDruid_OmenHealingTouch_enable
		Vasa_OmenHealingTouch = PQI_VachiusaHealingRestoDruid_OmenHealingTouch_value
		Vasa_NourishCheck = PQI_VachiusaHealingRestoDruid_Nourish_enable
		Vasa_Nourish = PQI_VachiusaHealingRestoDruid_Nourish_value
		Vasa_LifebloomFocusCheck = PQI_VachiusaHealingRestoDruid_LifebloomFocus_enable
		Vasa_RegrowthCheck = PQI_VachiusaHealingRestoDruid_Regrowth_enable
		Vasa_Regrowth = PQI_VachiusaHealingRestoDruid_Regrowth_value
		Vasa_OmenRegrowthCheck = PQI_VachiusaHealingRestoDruid_OmenRegrowth_enable
		Vasa_OmenRegrowth = PQI_VachiusaHealingRestoDruid_OmenRegrowth_value
		Vasa_RejuvenationCheck = PQI_VachiusaHealingRestoDruid_Rejuvenation_enable
		Vasa_Rejuvenation = PQI_VachiusaHealingRestoDruid_Rejuvenation_value
		Vasa_RejuvenationTankCheck = PQI_VachiusaHealingRestoDruid_RejuvenationTank_enable
		Vasa_RejuvenationTank = PQI_VachiusaHealingRestoDruid_RejuvenationTank_value
		Vasa_SwiftmendCheck = PQI_VachiusaHealingRestoDruid_Swiftmend_enable
		Vasa_Swiftmend = PQI_VachiusaHealingRestoDruid_Swiftmend_value
		Vasa_SwiftmendLimitCheck = PQI_VachiusaHealingRestoDruid_SwiftmendLimit_enable
		Vasa_SwiftmendLimit = PQI_VachiusaHealingRestoDruid_SwiftmendLimit_value
		Vasa_WildMushroomCheck = PQI_VachiusaHealingRestoDruid_WildMushroom_enable
		Vasa_WildMushroom = PQI_VachiusaHealingRestoDruid_WildMushroom_value
		Vasa_WildMushroomLimitCheck = PQI_VachiusaHealingRestoDruid_WildMushroomLimit_enable
		Vasa_WildMushroomLimit = PQI_VachiusaHealingRestoDruid_WildMushroomLimit_value	
		Vasa_WildGrowthCheck = PQI_VachiusaHealingRestoDruid_WildGrowth_enable
		Vasa_WildGrowth = PQI_VachiusaHealingRestoDruid_WildGrowth_value
		Vasa_WildGrowthLimitCheck = PQI_VachiusaHealingRestoDruid_WildGrowthLimit_enable
		Vasa_WildGrowthLimit = PQI_VachiusaHealingRestoDruid_WildGrowthLimit_value
		Vasa_RegrowthTankCheck = PQI_VachiusaHealingRestoDruid_RegrowthTank_enable
		Vasa_RegrowthTank = PQI_VachiusaHealingRestoDruid_RegrowthTank_value
		
		Vasa_IronbarkCheck = PQI_VachiusaCDRestoDruid_Ironbark_enable
		Vasa_Ironbark = PQI_VachiusaCDRestoDruid_Ironbark_value
		Vasa_NatureSwiftnessCheck = PQI_VachiusaCDRestoDruid_NatureSwiftness_enable
		Vasa_NatureSwiftness = PQI_VachiusaCDRestoDruid_NatureSwiftness_value
		Vasa_SpiritWalkerGraceCheck = PQI_VachiusaCDRestoDruid_SpiritWalkerGrace_enable
		Vasa_SpiritWalkerGrace = PQI_VachiusaCDRestoDruid_SpiritWalkerGrace_value
		Vasa_Talent90Check = PQI_VachiusaCDRestoDruid_Talent90_enable
		Vasa_Talent90 = PQI_VachiusaCDRestoDruid_Talent90_value
		Vasa_Talent90LimitCheck = PQI_VachiusaCDRestoDruid_Talent90Limit_enable
		Vasa_Talent90Limit = PQI_VachiusaCDRestoDruid_Talent90Limit_value
		Vasa_IncarnationCheck = PQI_VachiusaCDRestoDruid_Incarnation_enable
		Vasa_Incarnation = PQI_VachiusaCDRestoDruid_Incarnation_value
		Vasa_IncarnationLimitCheck = PQI_VachiusaCDRestoDruid_IncarnationLimit_enable
		Vasa_IncarnationLimit = PQI_VachiusaCDRestoDruid_IncarnationLimit_value	
		Vasa_ForceOfNatureCheck = PQI_VachiusaCDRestoDruid_ForceOfNature_enable
		Vasa_ForceOfNature = PQI_VachiusaCDRestoDruid_ForceOfNature_value
		Vasa_ForceOfNatureLimitCheck = PQI_VachiusaCDRestoDruid_ForceOfNatureLimit_enable
		Vasa_ForceOfNatureLimit = PQI_VachiusaCDRestoDruid_ForceOfNatureLimit_value	
		Vasa_GenesisCheck = PQI_VachiusaCDRestoDruid_Genesis_enable
		Vasa_Genesis = PQI_VachiusaCDRestoDruid_Genesis_value
		Vasa_GenesisLimitCheck = PQI_VachiusaCDRestoDruid_GenesisLimit_enable
		Vasa_GenesisLimit = PQI_VachiusaCDRestoDruid_GenesisLimit_value		
		Vasa_GenesisCountCheck = PQI_VachiusaCDRestoDruid_GenesisCount_enable
		Vasa_GenesisCount = PQI_VachiusaCDRestoDruid_GenesisCount_value		
		Vasa_TranquilityCheck = PQI_VachiusaCDRestoDruid_Tranquility_enable
		Vasa_Tranquility = PQI_VachiusaCDRestoDruid_Tranquility_value
		Vasa_TranquilityLimitCheck = PQI_VachiusaCDRestoDruid_TranquilityLimit_enable
		Vasa_TranquilityLimit = PQI_VachiusaCDRestoDruid_TranquilityLimit_value
					
		Vasa_AutoTargetCheck = PQI_VachiusaGeneralRestoDruid_AutoTarget_enable
		Vasa_AutoTarget = PQI_VachiusaGeneralRestoDruid_AutoTarget_value
		Vasa_InnervateCheck = PQI_VachiusaGeneralRestoDruid_Innervate_enable
		Vasa_Innervate = PQI_VachiusaGeneralRestoDruid_Innervate_value
		Vasa_SymbiosisCheck = PQI_VachiusaGeneralRestoDruid_Symbiosis_enable
		Vasa_Symbiosis = PQI_VachiusaGeneralRestoDruid_Symbiosis_value
		Vasa_DPSCheck = PQI_VachiusaGeneralRestoDruid_DPS_enable
		Vasa_DPS = PQI_VachiusaGeneralRestoDruid_DPS_value
		Vasa_NaturesCureCheck = PQI_VachiusaGeneralRestoDruid_NaturesCure_enable
		Vasa_NaturesCure = PQI_VachiusaGeneralRestoDruid_NaturesCure_value
		Vasa_LowManaCheck = PQI_VachiusaGeneralRestoDruid_LowMana_enable
		Vasa_LowMana = PQI_VachiusaGeneralRestoDruid_LowMana_value
		Vasa_RacialsCheck = PQI_VachiusaGeneralRestoDruid_Racials_enable
		Vasa_Racials = PQI_VachiusaGeneralRestoDruid_Racials_value
		Vasa_4xEventsCheck = PQI_VachiusaGeneralRestoDruid_4xEvents_enable
		Vasa_4xEvents = PQI_VachiusaGeneralRestoDruid_4xEvents_value
		Vasa_53EventsCheck = PQI_VachiusaGeneralRestoDruid_53Events_enable
		Vasa_53Events = PQI_VachiusaGeneralRestoDruid_53Events_value
		Vasa_54EventsCheck = PQI_VachiusaGeneralRestoDruid_54Events_enable
		Vasa_54Events = PQI_VachiusaGeneralRestoDruid_54Events_value	
		Vasa_SpecialEvents = PQI_VachiusaGeneralRestoDruid_SpecialEvents_enable	
		Vasa_AutoEventDispel = PQI_VachiusaGeneralRestoDruid_AutoEventDispel_enable
		Vasa_QueueSysCheck = PQI_VachiusaGeneralRestoDruid_QueueSys_enable
		Vasa_QueueSys = PQI_VachiusaGeneralRestoDruid_QueueSys_value	
		Vasa_Mouseover = PQI_VachiusaGeneralRestoDruid_MouseoverHeal_enable
		Vasa_TargetHeal = PQI_VachiusaGeneralRestoDruid_TargetHeal_enable
		Vasa_NPCMouseoverHeal = PQI_VachiusaGeneralRestoDruid_NPCMouseoverHeal_enable
		Vasa_PetHeal = PQI_VachiusaGeneralRestoDruid_PetHeal_enable
		Vdebug = PQI_VachiusaGeneralRestoDruid_Vdebug_enable
		Vasa_StopCasting = PQI_VachiusaGeneralRestoDruid_StopCasting_enable
		
		if Vasa_LowHP == nil then Vasa_LowHP = 80 end
		if Vasa_ActualHP == nil or Vasa_ActualHP then Vasa_ActualHP = false end
		
		-- Hotkeys
		if not PQI_Hotkeys_Functions_Set then
			function PQI_PauseRotation()
				if PQI_VachiusaHealingRestoDruid_PauseRotation_enable and PQI:IsHotkeys(PQI_VachiusaHealingRestoDruid_PauseRotation_key) then
				return true else return false 
			end	end
			function PQI_Talent60()
				if PQI_VachiusaHealingRestoDruid_Talent60_enable and PQI:IsHotkeys(PQI_VachiusaHealingRestoDruid_Talent60_key) then
				return true else return false
			end	end		
			function PQI_GenesisMod()
				if PQI_VachiusaHealingRestoDruid_GenesisMod_enable and PQI:IsHotkeys(PQI_VachiusaHealingRestoDruid_GenesisMod_key) then
				return true else return false
			end	end			
			function PQI_WildMushroomBloom()
				if PQI_VachiusaHealingRestoDruid_WildMushroomBloom_enable and PQI:IsHotkeys(PQI_VachiusaHealingRestoDruid_WildMushroomBloom_key) then
				return true else return false
			end	end	
			function PQI_Tranquility()
				if PQI_VachiusaHealingRestoDruid_Tranquility_enable and PQI:IsHotkeys(PQI_VachiusaHealingRestoDruid_Tranquility_key) then
				return true else return false
			end	end
			function PQI_Talent90()
				if PQI_VachiusaHealingRestoDruid_Talent90_enable and PQI:IsHotkeys(PQI_VachiusaHealingRestoDruid_Talent90_key) then
				return true else return false
			end	end		
			function PQI_AddingPlayersCT()
				if PQI_VachiusaHealingRestoDruid_AddingPlayersCT_enable and PQI:IsHotkeys(PQI_VachiusaHealingRestoDruid_AddingPlayersCT_key) then
				return true else return false
			end	end	
			function PQI_RemovingPlayersCT()
				if PQI_VachiusaHealingRestoDruid_RemovingPlayersCT_enable and PQI:IsHotkeys(PQI_VachiusaHealingRestoDruid_RemovingPlayersCT_key) then
				return true else return false
			end	end			
		end	
		
		Vasa_PauseRotationCheck = PQI_VachiusaHealingRestoDruid_PauseRotation_enable
		Vasa_Talent60Check = PQI_VachiusaHealingRestoDruid_Talent60_enable
		Vasa_GenesisModCheck = PQI_VachiusaHealingRestoDruid_GenesisMod_enable
		Vasa_WildMushroomBloomCheck = PQI_VachiusaHealingRestoDruid_WildMushroomBloom_enable
		Vasa_MTranquilityCheck = PQI_VachiusaHealingRestoDruid_Tranquility_enable
		Vasa_Talent90Check = PQI_VachiusaHealingRestoDruid_Talent90_enable
		Vasa_AddingPlayersCTCheck = PQI_VachiusaHealingRestoDruid_AddingPlayersCT_enable
		Vasa_RemovingPlayersCTCheck = PQI_VachiusaHealingRestoDruid_RemovingPlayersCT_enable
		
		VachiusaRestoDruid_PauseRotation_key = PQI_PauseRotation()
		VachiusaRestoDruid_Talent60_key = PQI_Talent60()
		VachiusaRestoDruid_GenesisMod_key = PQI_GenesisMod()
		VachiusaRestoDruid_WildMushroomBloom_key = PQI_WildMushroomBloom()
		VachiusaRestoDruid_Tranquility_key = PQI_Tranquility()
		VachiusaRestoDruid_Talent90_key = PQI_Talent90()
		VachiusaRestoDruid_AddingPlayersCT_key = PQI_AddingPlayersCT()
		VachiusaRestoDruid_RemovingPlayersCT_key = PQI_RemovingPlayersCT()	

		--Set PQI
		if not PQI_VachiusaRestoDruid_Set and VachiusaRestoDruid_AutoOpenPQIOptions_enable ~= nil then
			VAS_RunMacroText("/PQI show")
			VAS_RunMacroText("/PQI config show")
			VAS_RunMacroText("/PQI config width 220")
			if not VachiusaRestoDruid_AutoOpenPQIOptions_enable then
			VAS_RunMacroText("/PQI config hide") end
			PQI_VachiusaRestoDruid_Set = true
		end
	end

	
	if PQI_Variables_Loaded == nil then
		if not VSIWarning2 then
			VAS_WriteToChat("\124cFFFF55FFWarning: something wrong with VSI addon!")
			VSIWarning2 = true
		end
		return true
	end

	if not VAS_RotationStarted then
		if UnitLevel("player") ~= 90 then
			VAS_WriteToChat("\124cFFFF55FFWarning: only takes full effect when we're 90!")	
			return true --added
		end	
		QueueSystem()
		VAS_RotationStarted = true
	end

	if VAS_Moving("player") then
		Vasa_Moving = true
	else
		Vasa_Moving = false
	end

	--------------------------------------
	-- Adding Players to Custom Table
	--------------------------------------
	if Vasa_AddingPlayersCTCheck then
		if VachiusaRestoDruid_AddingPlayersCT_key
		and not GetCurrentKeyBoardFocus()
		and UnitExists("mouseover")
		and ( CanHeal("mouseover") 
		or UnitIsUnit("player", "mouseover") ) then  
			for i=1, #Vasa_CustomT do
				if Vasa_CustomT[i].GUID and Vasa_CustomT[i].GUID == UnitGUID("mouseover") then
					return false
				end
			end
			
			table.insert(Vasa_CustomT, { GUID = UnitGUID("mouseover") } )
			
			if not GetCVarBool("Vasa_Recording") then
				VAS_WriteToChat("We just added "..UnitName("mouseover").." to the Custom Healing Table.", "Alert")
			end
			return true
		
		end
	end

	--------------------------------------
	-- Removing Players from Custom Table
	--------------------------------------
	if Vasa_RemovingPlayersCTCheck then
		if VachiusaRestoDruid_RemovingPlayersCT_key
		and not GetCurrentKeyBoardFocus() 
		and UnitExists("mouseover")
		and ( CanHeal("mouseover") 
		or UnitIsUnit("player", "mouseover") )then
			for i=1, #Vasa_CustomT do
				if Vasa_CustomT[i].GUID and Vasa_CustomT[i].GUID == UnitGUID("mouseover") then
					if not GetCVarBool("Vasa_Recording") then
						VAS_WriteToChat("We just removed "..UnitName(Vasa_CustomT[i].Unit).." from the Custom Healing Table.", "Alert")
					end
					table.remove(Vasa_CustomT, i)
					return true
				end
			end
		end
	end

	if (VachiusaRestoDruid_PauseRotation_key and not GetCurrentKeyBoardFocus())
	 or UnitIsDeadOrGhost("player") 
	 or IsMounted() 
	 or (UnitBuffID("player",768) and Vasa_Moving) --Cat Form
	 or (UnitBuffID("player",783) and Vasa_Moving) --Travel Form 96562?
	 or (UnitChannelInfo("player") == GetSpellInfo(740)) --Tranquility
	 or UnitBuffID("player", 104269) then --drink
		if PQI_VachiusaGeneral_RotationEngine_value == 4 then
			raidfu = nil
			vicon = nil
			CompactRaidFrameContainer_ApplyToFrames(CompactRaidFrameContainer, "normal", VAS_UpdateIcon)
		elseif PQI_VachiusaGeneral_RotationEngine_value == 7 and not UnitCastingInfo("player") then
			raidfu = nil
			vicon = nil
			HealBot_OnEvent_VachiusaUpdate(vicon,raidfu)
		elseif PQI_VachiusaGeneral_RotationEngine_value == 8 and not UnitCastingInfo("player") then
			raidfu = nil
			vicon = nil
			ElvUF_OnEvent_VachiusaUpdate(vicon,raidfu)
		end
		return true
	end

	-- Healing Engine --
	if Vasa_54EventsCheck then
		if not UnitDebuffID("player",144850) --Test of Reliance
		and not UnitDebuffID("player",142861) then --Ancient Miasma
			SheuronEngine(Vasa_Mouseover, Vasa_LowHP, Vasa_ActualHP, Vasa_TargetHeal, Vasa_SpecialEvents, Vasa_PetHeal)  -- Deactivate Mouseover  ||   At what % Health do we consider someone LowHP  ||  Sort by Actual Health = true
		end
	else
		SheuronEngine(Vasa_Mouseover, Vasa_LowHP, Vasa_ActualHP, Vasa_TargetHeal, Vasa_SpecialEvents, Vasa_PetHeal)  -- Deactivate Mouseover  ||   At what % Health do we consider someone LowHP  ||  Sort by Actual Health = true	
	end

	if GetCVarBool("PQ_UseCustomT") then
		members = Vasa_CustomT
		lowhpmembers = 0
		for i=1, #Vasa_CustomT do
			if Vasa_CustomT[i].HP < 80 then
				lowhpmembers = lowhpmembers + 1
			end
		end
		
		table.sort(members, function(x,y) return x.HP < y.HP end)
	end

	if UnitAffectingCombat("player") then
		if UnitBuffID("player",5487) 
		and UnitThreatSituation("player") == 3 
		and not UnitCastingInfo("player") then
			return true		
		end
	end

	if Vasa_UnitInfo("player") <= 20 
	and UnitAffectingCombat("player") then
		if GetItemCount(5512,false,true) > 0	
		and VAS_SpellAvailable(5512) --Healthstone		
		and GetItemCooldown(5512) == 0 then
			if UnitCastingInfo("player") then
				VAS_SpellStopCasting()
			end	
			VAS_UseItemByName(5512)
			--VAS_WriteToChat("\124cFFFF55FFHealthstone - HP: " ..Vasa_UnitInfo("player")) 
			return true
		--elseif GetInventoryItemCooldown(6)==0 --Grounded Plasma Shield 	
		--then 
			--VAS_UseInventoryItem(6) 
			--return true
		elseif VAS_SpellAvailable(22812)	
		--and select(2,GetTalentRowSelectionInfo(5)) == 14
		--and IsUsableSpell(22812) 	
		--and select(2,GetSpellCooldown(22812)) < 2 
		then
			if UnitCastingInfo("player") then
				VAS_SpellStopCasting()
			end			
			VAS_Cast(22812,nil)	 			
			--VAS_WriteToChat("\124cFFFF55FFBarkskin - My HP: "..Vasa_UnitInfo("player"))		
			return true		
		elseif VAS_SpellAvailable(106922)	
		--and select(2,GetSpellCooldown(106922)) < 2 
		--and IsUsableSpell(115203) 	
		and not UnitBuffID("player",22812) then --Barkskin
			if UnitCastingInfo("player") then
				VAS_SpellStopCasting()
			end			
			VAS_Cast(106922,nil)	 	
			--VAS_WriteToChat("\124cFFFF55FFMight of Ursoc - My HP: "..Vasa_UnitInfo("player"))	
			return true		
		end
	end

	if Vasa_RacialsCheck
	and UnitAffectingCombat("player") then

		local PQ_Class = select(2, UnitClass("player")) 
		
		--Draenei 
		local GiftOfTheNaaru = 59542	
		--Blood Elf
		local ArcaneTorrent = 28730 --mana regen
		
		if PQ_Class == "PALADIN" then
			GiftOfTheNaaru = 59542	
		elseif PQ_Class == "MONK" then 
			GiftOfTheNaaru = 121093
			ArcaneTorrent = 129597 --chi regen
		elseif PQ_Class == "PRIEST" then  
			GiftOfTheNaaru = 59544
		elseif PQ_Class == "SHAMAN" then 
			GiftOfTheNaaru = 59547
		end

		--Troll 
		local Berserking = 26297 
		--Undead
		local WillOfTheForsaken = 7744  
		--Dwarven 
		local Stoneform = 20594 
		--Human 
		local EveryManForHimself = 59752
		--Undead 
		--local Cannibalize = 20577 --not much helpful
		--Orc 
		local BloodFury = 33702
		--Gloves Engineer
		local _, GECooldown, GEReady = GetInventoryItemCooldown("player", 10)
				
		--HP
		if IsSpellKnown(GiftOfTheNaaru) 
		--and GetSpellCooldown(GiftOfTheNaaru) == 0 
		and VAS_SpellAvailable(GiftOfTheNaaru)
		and Vasa_UnitInfo("player") <= 30	
		then		
			VAS_Cast(GiftOfTheNaaru,nil)	 
			return true 
		end
		
		--Mana
		if IsSpellKnown(ArcaneTorrent) 
		and PQ_Class ~= "MONK"
		--and GetSpellCooldown(ArcaneTorrent) == 0 
		and VAS_SpellAvailable(ArcaneTorrent)
		and select(3, Vasa_UnitInfo("player")) <= 80	
		then		
			VAS_Cast(ArcaneTorrent,nil)	 
			return true 
		end	
		
		--CDs
		if not racialcds then
			function racialcds()
				if IsSpellKnown(BloodFury) 
				--and GetSpellCooldown(BloodFury) == 0 
				and VAS_SpellAvailable(BloodFury)	
				then		
					VAS_Cast(BloodFury,nil)	 
					return true 
				elseif IsSpellKnown(Berserking) 
				--and GetSpellCooldown(Berserking) == 0 
				and VAS_SpellAvailable(Berserking)	
				then		
					VAS_Cast(Berserking,nil)	 
					return true 
				elseif GECooldown == 0 
				and GEReady == 1 then
					VAS_UseInventoryItem(10)
				end
			end
		end
		
		if lowhpmembers >=5 then
			racialcds()
		end
		
		--Removes any Charm, Fear and Sleep effect
		if not GotFear then
			function GotFear(t) 
				local debuff = { 10326, 8122, 2094, 5782, 5484, 6358, 5246 }
				for i=1, #debuff do if UnitDebuffID(t,debuff[i]) then return true end end
			end
		end
		if IsSpellKnown(WillOfTheForsaken) 
		--and GetSpellCooldown(WillOfTheForsaken) == 0 
		and VAS_SpellAvailable(WillOfTheForsaken)	
		and GotFear("player")
		then		
			VAS_Cast(WillOfTheForsaken,nil)	 
			return true 
		end  
		
		--Removes all poison, disease and bleed effects and reduces all damage taken by 10% for 8 sec
		if not GotPoison then
			function GotPoison(t)
				local i, debuff = 1, select(5,UnitDebuff(t, 1)) 
				while debuff do
					if debuff == "Poison" or debuff == "Disease" then return true end
					i = i + 1 debuff = select(5,UnitDebuff(t, i)) 
				end
			end
		end	
		if IsSpellKnown(Stoneform) 
		--and GetSpellCooldown(Stoneform) == 0 
		and VAS_SpellAvailable(Stoneform)	
		and GotPoison("player")
		then		
			VAS_Cast(Stoneform,nil)	 
			return true 
		end    	
		
		--Removes all movement impairing effects and all effects which cause loss of control of your character
		if not LostControl then
			function LostControl(t) 
				local debuff = { 122, 10326, 8122, 2094, 5782, 5484, 6358, 5246, 408 }
				for i=1, #debuff do if UnitDebuffID(t,debuff[i]) then return true end end
			end
		end  
		if IsSpellKnown(EveryManForHimself) 
		--and GetSpellCooldown(EveryManForHimself) == 0 
		and VAS_SpellAvailable(EveryManForHimself)	
		and LostControl("player")
		then		
			VAS_Cast(EveryManForHimself,nil)	 
			return true 
		end		
	end

	if Vasa_54EventsCheck 
	and UnitAffectingCombat("player") then
		local boss,bossid = bossid()
		local dispelid = 88423	
		local rangecheckid = 50464		
		local buff = { }
		stopcasting = false
		stopdps = false
		LLdebuff = false
		LLdebuffunit = false	
		if UnitExists(boss) then
			--local _, _, rdifficulty = GetInstanceInfo()
			if bossid == 71515 then --General Nazgrim
				if UnitBuffID("boss1", 143593) then --Defensive Stance
					stopdps = true				
				else
					stopdps = false
				end
			elseif bossid == 71995 or bossid == 71996 or bossid == 72000 then --Amalgam of Corruption - Norushen
				if UnitDebuffID("player",144850) --Test of Reliance
				then 
					BossSheuronEngine(Vasa_Mouseover, Vasa_LowHP, Vasa_ActualHP, Vasa_TargetHeal, 3, true, rangecheckid)  -- Deactivate Mouseover  ||   At what % Health do we consider someone LowHP  ||  Sort by Actual Health = true
					local buff  = { 144514 } --Lingering Corruption
					RaidDispel(dispelid,buff) 	
				end
			elseif bossid == 71475 or bossid == 71479 or bossid == 71480 then --The Fallen Protectors
				local buff  = { 143434 } --Shadow Word: Bane
				RaidDispel(dispelid,buff) 	
			elseif bossid == 71734 then --Sha of Pride
				if UnitDebuffID("player",144359) then
					local buff  = { 144351 } --Mark of Arrogance
					RaidDispel(dispelid,buff) 			
				end	
			elseif bossid == 71454 then --Malkorok	
				local buff  = { 142913 } 	
				RaidRangeDispel(dispelid,buff,8) 	
				if UnitDebuffID("player",142861) then --Ancient Miasma - 143983 or 142906
					ShieldSheuronEngine(Vasa_Mouseover, Vasa_LowHP, Vasa_ActualHP, Vasa_TargetHeal, Vasa_PetHeal)  -- Deactivate Mouseover  ||   At what % Health do we consider someone LowHP  ||  Sort by Actual Health = true					
				end
			elseif bossid == 71161 and PQI_VachiusaGeneral_RotationEngine_value ~= 4 and PQI_VachiusaGeneral_RotationEngine_value ~= 7 and PQI_VachiusaGeneral_RotationEngine_value ~= 8 then --Kil'ruk the Wind-Reaver - Paragons of the Klaxxi
				if UnitDebuffID("player",141858) then --Ingenious			
					if not tIngenious or (#tIngenious > 0 and (GetTime() > tIngenious[1].Time + 30)) then
						tIngenious = { }						
						local qTime = GetTime() 
						local lastmax = 0
						local maxunit = "player"		
						local lasttype = "notype"						
						local ClassList = { {'WARRIOR', 0 }, {'PALADIN', 0 }, {'HUNTER', 0 }, {'ROGUE', 0 }, {'PRIEST', 0 }, {'DEATHKNIGHT', 0 }, {'SHAMAN', 0 }, {'MAGE', 0 }, {'WARLOCK', 0 }, {'MONK', 0 }, {'DRUID', 0 } }				
						local RaceList = { {'Draenei', 0 }, {'Gnome', 0 }, {'Human', 0 }, {'NightElf', 0 }, {'Worgen', 0 }, {'Pandaren', 0 }, {'BloodElf', 0 }, {'Goblin', 0 }, {'Orc', 0 }, {'Tauren', 0 }, {'Troll', 0 }, {'Scourge', 0 } }
						for i=1,25 do
							local unitCheck = "raid"..i
						    if UnitExists(unitCheck) and UnitIsPlayer(unitCheck) then
							local _, unitClass = UnitClass(unitCheck)				    	
							local _, unitRace = UnitRace(unitCheck)				    	
							if unitClass and UnitRace then	
									--Class
									for j=1, #ClassList do
										if unitClass == ClassList[j][1] then
											--VAS_WriteToChat("Debug1 - Num: " ..ClassList[j][2].." - Class: " ..ClassList[j][1])
											ClassList[j][2] = ClassList[j][2] + 1
											if ClassList[j][2] > lastmax then
												lastmax = ClassList[j][2]
												maxunit = unitCheck
												lasttype = ClassList[j][1]
											end												
										end		
									end
									--Race
									for j=1, #RaceList do
										if unitRace == RaceList[j][1] then
											--VAS_WriteToChat("Debug1 - Num: " ..RaceList[j][2].." - Race: " ..RaceList[j][1])
											RaceList[j][2] = RaceList[j][2] + 1
											if RaceList[j][2] > lastmax then
												lastmax = RaceList[j][2]
												maxunit = unitCheck
												lasttype = RaceList[j][1]
											end												
										end		
									end
							end			               	
						    end
						end				
						--VAS_WriteToChat("Debug1 - Unit: " ..maxunit.." - Type: " ..lasttype.." - Total: " ..lastmax.." - Time: " ..qTime)		
						table.insert(tIngenious, { Unit = maxunit, Type = lasttype, Total = lastmax, Time = qTime } )			
						return true								
					else
						if #tIngenious > 0 then			
							if UnitExists(tIngenious[1].Unit) 
							and IsSpellInRange(GetSpellInfo(rangecheckid),tIngenious[1].Unit) == 1
							and CanHeal(tIngenious[1].Unit) then	
								VAS_TargetUnit(tIngenious[1].Unit) 
								--Press the ExtraActionButton 
								VAS_RunMacroText("/click ExtraActionButton1")                     
								VAS_RunMacroText("/targetlasttarget")
								--VAS_WriteToChat("Ingenious Name: "..UnitName(tIngenious[1].Unit).." - Type: "..tIngenious[1].Type.." - Total: "..tIngenious[1].Total.." - Time: "..tIngenious[1].Time)						        					        	   	
							end
						end				
					end   				
				else
					tIngenious = false
				end
			elseif bossid == 71529 then --Thok the Bloodthirsty
				local buff  = { 143791 } --Corrosive Blood
				RaidDispel(dispelid,buff) 
				local DeafeningScreech = GetSpellInfo(143343) --Deafening Screech
				local bossCasting,_,_,_,_,castEnd = UnitCastingInfo(boss) 
				if (bossCasting == DeafeningScreech) then
					stopcasting = true
				end							
			end	
		end
	end

	-- QueueSys
	if Vasa_QueueSysCheck 
	then
		local dispelid = 88423	
		local rangecheckid = 50464		
		if #Queue_Sys > 0 then	
			if VAS_SpellAvailable(dispelid) 
			--and select(2,GetSpellCooldown(dispelid)) < 2
			and UnitExists(Queue_Sys[1].Unit)
			and IsUsableSpell(dispelid)
			and IsSpellInRange(GetSpellInfo(dispelid),Queue_Sys[1].Unit) == 1
			and CanHeal(Queue_Sys[1].Unit)
			and not VAS_IsOutOfSight(Queue_Sys[1].Unit) then
				if not UnitChannelInfo("player")
				and not UnitCastingInfo("player") 
				then	
					VAS_Cast(dispelid,Queue_Sys[1].Unit)	
					return true	
				end
			end
		end
		
		if Queue_Spell then
			if #Queue_Spell > 0 then	
				if GetTime() - Queue_Spell[1].Time >= 10 then
					--VAS_WriteToChat("Removed expired queue "..Queue_Spell[1].SpellID)
					Queue_Spell = { }				
					return true
				end			
				if #Queue_Spell > 1 then			
					if Queue_Spell[1].SpellID == Queue_Spell[2].SpellID and Queue_Spell[1].Unit == Queue_Spell[2].Unit then
						--VAS_WriteToChat("Removed dup queue "..Queue_Spell[1].SpellID)
						table.remove(Queue_Spell,2)	
						return true	
					end
				end
				
				local qunit = "player"
				if Queue_Spell[1].Unit == "low" then
					qunit = members[1].Unit
				elseif Queue_Spell[1].Unit == "tank" then
					if #Vasa_Tanks > 0 then
						for i=1, #Vasa_Tanks do
							if UnitThreatSituation(Vasa_Tanks[i].Unit) then
								qunit = Vasa_Tanks[i].Unit
								break
							end
						end
					end
					if UnitThreatSituation(members[1].Unit)	== 3 then
						qunit = members[1].Unit
					end			
				else
					qunit = Queue_Spell[1].Unit
				end
				
				if VAS_SpellAvailable(tonumber(Queue_Spell[1].SpellID)) 
				--and select(2,GetSpellCooldown(tonumber(Queue_Spell[1].SpellID))) < 2
				and UnitExists(qunit)
				then
					if not UnitChannelInfo("player")
					and not UnitCastingInfo("player") 
					then					
						local qmembers = members
						table.sort(qmembers, function(x) return UnitIsUnit(qunit,x.Unit) end)
						if UnitIsUnit(qmembers[1].Unit,qunit) then
							qunit = qmembers[1].Unit	
						else
							if IsSpellInRange(GetSpellInfo(Queue_Spell[1].SpellID),Queue_Spell[1].Unit) then
								qunit = Queue_Spell[1].Unit	
							else
								qunit = "player"			
							end
						end
						
						SpellSUCCEEDED(Queue_Spell[1].SpellID,qunit)
						VAS_Cast(Queue_Spell[1].SpellID,qunit)									
						return true						
					end
				end						
			end
		end	
	end

	--NPCMouseoverHeal
	if Vasa_NPCMouseoverHeal
	and UnitAffectingCombat("player")
	then
		local dispelid = 88423	
		local rangecheckid = 50464	
		if UnitExists("mouseover")				
		and not UnitIsPlayer("mouseover") then
			local npcID = tonumber(UnitGUID("mouseover"):sub(6,10), 16) 				
			if npcID == 71604 --Contaminated Puddle - Immerseus - SoO
			or npcID == 71995 or npcID == 71996 or npcID == 72000 --Norushen
			or npcID == 71357 --Wrathion 
			then				
				if IsSpellInRange(GetSpellInfo(rangecheckid),"mouseover")
				and Vasa_UnitInfo("mouseover") < 100 then	
					if VAS_SpellAvailable(8936) 		 
					 and IsUsableSpell(8936) 
					 and select(3, Vasa_UnitInfo("player")) > 70
					 and not UnitCastingInfo("player") then
						VAS_Cast(8936,"mouseover")	 			 		
						--VAS_WriteToChat("\124cFFFF55FFCast Regrowth - Name: " ..UnitName("mouseover").." - HP: "..Vasa_UnitInfo("mouseover").." - NPCID: "..npcID) 			
						return true
					end
					
					if VAS_SpellAvailable(5185) 		 
					and IsUsableSpell(5185) 
					and not UnitCastingInfo("player") then 					
						VAS_Cast(5185,"mouseover")	 						 		
						--VAS_WriteToChat("\124cFFFF55FFCast HealingTouch - Name: " ..UnitName("mouseover").." - HP: "..Vasa_UnitInfo("mouseover").." - NPCID: "..npcID) 					
						return true				
					end	
				end
			end		
		elseif UnitExists("focus")				
		and not UnitIsPlayer("focus") then
			local npcID = tonumber(UnitGUID("focus"):sub(6,10), 16) 				
			if npcID == 71604 --Contaminated Puddle - Immerseus - SoO
			or npcID == 71995 or npcID == 71996 or npcID == 72000 --Norushen
			or npcID == 71357 --Wrathion 
			then
				if IsSpellInRange(GetSpellInfo(rangecheckid),"focus") --FlashHeal
				then		
					local focushp = CalculateHP("focus")
					if focushp ~= nil and select(2, CalculateHP("focus")) ~= nil then
						table.insert(members, { Unit = "focus", HP = focushp, AHP = select(2, CalculateHP("focus")), IsNPC = true } )
					end
					if #members > 0 then
						table.sort(members, function(x,y) return x.HP < y.HP end)
					end				
				end
			end	
		end
	end

	if 100 * UnitPower("player") / UnitPowerMax("player") <= 50
	and not UnitCastingInfo("player")
	and not UnitAffectingCombat("player") 
	and VAS_SpellAvailable(80618) --Mage cookies	
	and not UnitBuffID("player", 104269)
	and not Vasa_Moving 
	and GetItemCount(80618,false,true) > 0
	and GetItemCooldown(80618) == 0 then
		VAS_UseItemByName(80618)
		--VAS_WriteToChat("\124cFFFF55FFMage cookies - HP: " ..Vasa_UnitInfo("player")) 
		return true
	end

	--Stop Casting
	if Vasa_StopCasting then
		local boss,bossid = bossid()
		
		if SpellIsTargeting() then
			VAS_SpellStopCasting()
		elseif UnitBuffID("player", 100977) --Harmony
		and ((UnitCastingInfo("player") == GetSpellInfo(50464)) --Nourish 
		or (UnitCastingInfo("player") == GetSpellInfo(5176))) --Wrath
		and (CalStop(members[1].Unit) < 40 or (lowhpmembers > 3 and CalStop(members[1].Unit) < 70)) 
		and IsUsableSpell(8936) --prevent stop loop
		and select(3, Vasa_UnitInfo("player")) >= 12
		and UnitAffectingCombat("player") then
				VAS_SpellStopCasting() 
				--VAS_WriteToChat("\124cFFFF55FFStop Casting Nourish/Wrath - HP: " ..members[1].HP) 		
				return true 
		elseif (UnitCastingInfo("player") == GetSpellInfo(50464)) --Nourish
		and UnitBuffID("player", 100977) --Harmony
		and IsSpellInRange(GetSpellInfo(50464),members[1].Unit) == 1
		and CalStop(members[1].Unit) > Vasa_Nourish and CalStop(members[1].Unit) > 95 
		and UnitAffectingCombat("player") then
			if (select(7, UnitBuffID("player", 100977)) - GetTime() > 2) then
				VAS_SpellStopCasting() 	
				--VAS_WriteToChat("\124cFFFF55FFStop Cast Nourish - Name: " ..UnitName(members[1].Unit).." - Current HP: "..CalStop(members[1].Unit).." - overheal: "..select(2, CalStop(members[1].Unit)))	
				return true 
			end
		elseif UnitAffectingCombat("player")
		and (UnitCastingInfo("player") == GetSpellInfo(5185)) --HealingTouch
		and IsSpellInRange(GetSpellInfo(5185),members[1].Unit) == 1
		and bossid ~= 62442 --Tsulong 
		and bossid ~= nil
		and CalStop(members[1].Unit) > Vasa_HealingTouch and CalStop(members[1].Unit) > Vasa_DPS then 
			VAS_SpellStopCasting() 
			--VAS_WriteToChat("\124cFFFF55FFStop Casting HealingTouch - HP: " ..members[1].HP.." - npcid :"..bossid) 		
			return true 
		elseif UnitAffectingCombat("player")
		and (UnitCastingInfo("player") == GetSpellInfo(8936)) --Regrowth 
		and IsSpellInRange(GetSpellInfo(8936),members[1].Unit) == 1
		and bossid ~= 62442 --Tsulong 
		and bossid ~= nil
		and CalStop(members[1].Unit) > Vasa_Regrowth and CalStop(members[1].Unit) > Vasa_DPS then 
			VAS_SpellStopCasting() 
			--VAS_WriteToChat("\124cFFFF55FFStop Casting Regrowth - HP: " ..members[1].HP.." - npcid :"..bossid)	
			return true 	
		end
	end

	--AutoTarget
	if Vasa_AutoTargetCheck then
		if (not UnitExists("focus")
			or UnitIsDeadOrGhost("focus")
			or not UnitInRange("focus") 
			or not UnitIsConnected("focus")
			or not UnitCanCooperate("player","focus"))
		and (UnitIsDeadOrGhost("target") 
			or not UnitExists("target"))
		and PQI_VachiusaGeneral_RotationEngine_value ~= 4 and PQI_VachiusaGeneral_RotationEngine_value ~= 7 and PQI_VachiusaGeneral_RotationEngine_value ~= 8
		and #Vasa_Tanks > 0 then
			for i=1, #Vasa_Tanks do
				if UnitThreatSituation(Vasa_Tanks[i].Unit) == 3			
				and UnitAffectingCombat("player")		 
				then		
					VAS_AutoFocus(Vasa_Tanks[i].Unit)
					--VAS_TargetUnit(Vasa_Tanks[i].Unit)           		
					--VAS_RunMacroText("/focus")			
					--VAS_RunMacroText("/targetlasttarget")			
				end
			end
		end
		
		if UnitExists("focus")
		and (UnitIsDeadOrGhost("target") 
			or not UnitExists("target"))
		and not UnitIsDeadOrGhost("focustarget")
		and not UnitIsDeadOrGhost("focus")
		and UnitExists("focustarget")
		and UnitCanAttack("player", "focustarget")
		and IsSpellInRange(GetSpellInfo(8921),"focustarget") == 1
		and not VAS_IsOutOfSight("focustarget")
		and UnitAffectingCombat("player") then
			VAS_TargetUnit("focustarget")
			return false 	
		end
	end

	--MarkOfTheWild
	if not UnitBuffID("player",1126)
	and not UnitBuffID("player",20217)
	and not UnitBuffID("player",90363)
	and not UnitBuffID("player",115921) 
	and VAS_SpellAvailable(1126)
	and IsUsableSpell(1126) 
	and not UnitCastingInfo("player") 
	then
		VAS_Cast(1126,"player")
		return true
	end

	if not UnitBuffID("player", 79640) --Enhanced Intellect - Flask of Enhancement from Alchemist Flask
	and not UnitBuffID("player", 105689) --Flask of Spring Blossoms	
	and not UnitBuffID("player", 105694) --Flask of the Earth	
	and not UnitBuffID("player", 105693) --Flask of Falling Leaves
	and not UnitBuffID("player", 105691) --Flask of the Warm Sun
	and not UnitBuffID("player", 105696) --Flask of Winter's Bite
	and GetItemCount(75525,false,false) > 0 
	and ( select(2, GetItemCooldown(75525)) == 0 ) 
	--and not UnitChannelInfo("player")
	then
	    VAS_UseItemByName(75525)
	    return true
	end

	--HeartOfTheWild (TC)
	if (VachiusaRestoDruid_Talent90_key and not GetCurrentKeyBoardFocus())
	or (Vasa_Talent90Check and AverageHealth(Vasa_Talent90Limit) <= Vasa_Talent90 and not UnitBuffID("player", 106731)) then
		if not UnitChannelInfo("player") 
		and VAS_SpellAvailable(108288)		
		and select(2,GetTalentRowSelectionInfo(6)) == 16
		and not UnitCastingInfo("player") 
		and UnitAffectingCombat("player")
		--and GetSpellCooldown(108288) == 0 
		then
		  VAS_Cast(108288,nil)		   
		  --VAS_WriteToChat("\124cFFFF55FFRight Control Key Down - HeartOfTheWild!")
		  return true
		end	
	end

	--Incarnation (TC)
	if (VachiusaRestoDruid_Talent60_key and not GetCurrentKeyBoardFocus() and Vasa_Talent60Check)
	or (Vasa_IncarnationCheck and AverageHealth(Vasa_IncarnationLimit) <= Vasa_Incarnation and not UnitBuffID("player", 124974) and not UnitBuffID("player", 108288)) then
		if not UnitChannelInfo("player") 
		and VAS_SpellAvailable(106731)	
		and select(2,GetTalentRowSelectionInfo(4)) == 11
		and not UnitBuffID("player", 106731)
		and not UnitCastingInfo("player") 	
		and UnitAffectingCombat("player")
		--and GetSpellCooldown(106731) == 0 
		then
		  VAS_Cast(106731,nil)		   
		  --VAS_WriteToChat("\124cFFFF55FFRight Shift Key Down - Incarnation!")
		  return true
		end
	end

	--ForceOfNature (TC)
	if (VachiusaRestoDruid_Talent60_key and not GetCurrentKeyBoardFocus() and Vasa_Talent60Check)
	and select(2,GetTalentRowSelectionInfo(4)) == 12
	then	
		if not UnitChannelInfo("player") 
		and VAS_SpellAvailable(106737)		
		and IsSpellInRange(GetSpellInfo(106737),members[1].Unit) 
		and not UnitCastingInfo("player")
		and GetSpellCharges(106737) > 0 
		and Vasa_CheckLastCast(106737, 2) 
		then
		  VAS_CustomTarget = members[1].Unit
		  VAS_Cast(106737,VAS_CustomTarget)
		  --VAS_WriteToChat("\124cFFFF55FFRight Shift Key Down - ForceOfNature!")
		  return true
		end
	end

	if Vasa_ForceOfNatureCheck 
	and select(2,GetTalentRowSelectionInfo(4)) == 12 then
		if ((AverageHealth(Vasa_ForceOfNatureLimit) <= Vasa_ForceOfNature) and GetSpellCharges(106737) > 0)
		or GetSpellCharges(106737) == 3 then	
			if GetSpellCharges(106737) == 3 then
				local Vasa_ForceOfNature = 99
				local Vasa_ForceOfNatureLimit = 1
			end
			PRGetDistanceTable((Vasa_ForceOfNature+10), 10, Vasa_ForceOfNatureLimit)	
			PRGetDistanceTablebyHP(Vasa_ForceOfNature,Vasa_ForceOfNatureLimit)		
			if IsSpellInRange(GetSpellInfo(106737),prdistancebyhp[1].Unit) 
			and prdistancebyhp[1].PD >= Vasa_ForceOfNatureLimit
			and prdistancebyhp[1].HP <= Vasa_ForceOfNature 
			and Vasa_CheckLastCast(106737, 3) 
			and not UnitCastingInfo("player") then	
				VAS_CustomTarget = prdistancebyhp[1].Unit
				VAS_Cast(106737,VAS_CustomTarget)
				return true			
			end		
		end
	end

	--NatureVigil (TC)
	if (VachiusaRestoDruid_Talent90_key and not GetCurrentKeyBoardFocus())
	or (Vasa_Talent90Check and AverageHealth(Vasa_Talent90Limit) <= Vasa_Talent90 and not UnitBuffID("player", 106731)) then
		if not UnitChannelInfo("player") 
		and UnitAffectingCombat("player")
		and not UnitCastingInfo("player") 
		and VAS_SpellAvailable(124974)		
		and select(2,GetTalentRowSelectionInfo(6)) == 18
		--and GetSpellCooldown(124974) == 0 
		then
		  VAS_Cast(124974,nil)		   
		  --VAS_WriteToChat("\124cFFFF55FFRight Control Key Down - NatureVigil!")
		  return true
		end
	end

	--Symn SpiritWalker's Grace from Shaman (work good with Tranquility) or Cleanse from Pally
	if Vasa_SpiritWalkerGraceCheck then
		if members[1].HP < Vasa_SpiritWalkerGrace 
		and UnitAffectingCombat("player")	
		and IsUsableSpell(110806) --druid spell id 79206
		and VAS_Moving 
		and not UnitCastingInfo("player") 
		and UnitBuffID("player", 110309)
		and VAS_SpellAvailable(110806)
		then 
			VAS_Cast(110806,nil)
			--VAS_WriteToChat("\124cFFFF55FFSpirit walker grace - HP: "..members[1].HP)
			return true 
		end
	end

	--Tranquility (TC)
	if Vasa_MTranquilityCheck then	
		if (VachiusaRestoDruid_Tranquility_key and not GetCurrentKeyBoardFocus()) then
			if VAS_SpellAvailable(740)	
			and UnitAffectingCombat("player")		
			and IsUsableSpell(740)		
			--and select(2,GetSpellCooldown(740)) < 2 
			then
				if UnitCastingInfo("player") then
					VAS_SpellStopCasting()
				end
				VAS_Cast(740,nil)		   
				--VAS_WriteToChat("\124cFFFF55FFRight Alt Key Down - Tranquility!")
				return true
			end
		end		
	end
	--Tranquility 
	if Vasa_TranquilityCheck then
		if VAS_SpellAvailable(740)	
		--and select(2,GetSpellCooldown(740)) < 2
		and not UnitBuffID("player", 108288)
		and IsUsableSpell(740) 
		and UnitAffectingCombat("player") 
		and not stopcasting 
		and not LLdebuff then
			if UnitBuffID("player", 106731) --Incarnation: Tree of Life		
			or (AverageHealth(Vasa_TranquilityLimit) <= Vasa_Tranquility and not UnitBuffID("player", 124974) and not UnitBuffID("player", 108288)) then --Nature's Vigil, HoTW
				if UnitCastingInfo("player") then
					VAS_SpellStopCasting()
				end
				
				if Vasa_SpiritWalkerGraceCheck then
					if IsUsableSpell(110806) --druid spell id 79206
					and UnitBuffID("player", 110309)
					and VAS_SpellAvailable(110806) then 
						VAS_Cast(110806,"player")	
						--VAS_WriteToChat("\124cFFFF55FFSpirit walker grace then Tranquility")
					end
				end		
				--VAS_WriteToChat("\124cFFFF55FFTranquility - Raid HP: "..AverageHealth(Vasa_TranquilityLimit))		
				VAS_Cast(740,"player")	
				return true
			end
		end
	end

	if 100 * UnitPower("player") / UnitPowerMax("player") < 80
	and GetInventoryItemCooldown("player",14) == 0
	and not UnitCastingInfo("player") 
	then VAS_UseInventoryItem(14)
	end

	--Innervate
	if Vasa_InnervateCheck then
		if select(3, Vasa_UnitInfo("player")) <= Vasa_Innervate
		--and GetSpellCooldown(29166) == 0
		and not UnitCastingInfo("player") 
		and not UnitBuffID("player",768) --cat form
		and not UnitBuffID("player",5487) --bear form
		and VAS_SpellAvailable(29166) then	
			--VAS_WriteToChat("\124cFFFF55FFRight Control Key Down - Innervate!")	
			VAS_Cast(29166,"player")	
			return true 
		end
	end

	--TsulongHeal 
	if Vasa_53EventsCheck then	
		local bossCheck = "boss1" 
		local tsulongboss = false
		if UnitExists(bossCheck) then 
			local npcID = tonumber(UnitGUID(bossCheck):sub(6,10), 16) 	        
			if npcID == 62442 
			and UnitAffectingCombat("player") then --Tsulong	
				--VAS_WriteToChat("\124cFFFF55FFDebug NPCID: " ..npcID) 
				tsulongboss = true
			end
		end	
		
		if tsulongboss
		and VAS_SpellAvailable(5185)
		and IsUsableSpell(5185) 
		and IsSpellInRange(GetSpellInfo(5185),"boss1") == 1
		and not Vasa_Moving then
			if Vasa_UnitInfo("boss1") < 99 then
				--if GetInventoryItemCooldown(10)==0 then
				--if select(2,GetInventoryItemCooldown(10)) < 2 then
					--VAS_UseInventoryItem(10)
					--VAS_WriteToChat("\124cFFFF55FFGloves Engineer buff!")			
				--end	 			

				if VAS_SpellAvailable(33763)  
				and IsUsableSpell(33763) 
				and UnitBuffID("boss1", 33763, "PLAYER") then	
					if select(7, UnitBuffID("boss1", 33763, "PLAYER")) - GetTime() <= 2 
					and select(4, UnitBuffID("boss1", 33763, "PLAYER")) < 3	
					and not UnitCastingInfo("player") then
						VAS_Cast(33763,"boss1")	 
						--VAS_WriteToChat("\124cFFFF55FFCast Lifebloom Tsulong - HP: " ..Vasa_UnitInfo("boss1")) 	
						return true			 	
					end
				elseif VAS_SpellAvailable(33763)  
				and IsUsableSpell(33763) 
				and not UnitBuffID("boss1", 33763, "PLAYER") 
				and not UnitCastingInfo("player") then
					VAS_Cast(33763,"boss1")	 
					--VAS_WriteToChat("\124cFFFF55FFCast Lifebloom Tsulong - HP: " ..Vasa_UnitInfo("boss1")) 	
					return true			 				 				
				end
				
				if VAS_SpellAvailable(774) 
				and IsUsableSpell(774) 	 		 	
				and not UnitBuffID("boss1", 774, "PLAYER") 
				and not UnitCastingInfo("player") then	 		
					VAS_Cast(774,"boss1")	 
					--VAS_WriteToChat("\124cFFFF55FFCast Rejuvenation Tsulong - HP: " ..Vasa_UnitInfo("boss1")) 
					return true						 			 	
				end
				
				if VAS_SpellAvailable(18562) 
				and IsUsableSpell(18562)		
				--and select(2,GetSpellCooldown(18562)) < 2 
				and UnitBuffID("boss1", 774)
				and (select(3, Vasa_UnitInfo("player")) > 70 or UnitDebuff("player","Bathed in Light") or UnitDebuff("player","Омовение светом") or UnitDebuff("player","In Licht gebadet")) --Bathed in Light buff		
				and not UnitCastingInfo("player") then
					VAS_Cast(18562,"boss1")	 
					--VAS_WriteToChat("\124cFFFF55FFCast Swiftmend Tsulong - HP: " ..Vasa_UnitInfo("boss1")) 
					return true			
				end	 	

				--NatureSwiftness 
				if not UnitBuffID("player",132158)
				and VAS_SpellAvailable(132158)
				and select(2,GetTalentRowSelectionInfo(2)) == 4
				--and select(2,GetSpellCooldown(132158)) < 2
				and (UnitDebuff("player","Bathed in Light") or UnitDebuff("player","Омовение светом") or UnitDebuff("player","In Licht gebadet")) --Bathed in Light buff		
				and not UnitCastingInfo("player") then
					VAS_Cast(132158,"player")
					VAS_Cast(5185,"boss1")	 			
					--VAS_WriteToChat("\124cFFFF55FFCast HealingTouch with NatureSwiftness on Tsulong - HP: " ..Vasa_UnitInfo("boss1"))	 		
					return true									
				end	
				
				if VAS_SpellAvailable(8936) 		 
				 and IsUsableSpell(8936) 
				 and not UnitBuffID("player", 132158) --NatureSwiftness
				 and (select(3, Vasa_UnitInfo("player")) > 70 or UnitDebuff("player","Bathed in Light") or UnitDebuff("player","Омовение светом") or UnitDebuff("player","In Licht gebadet")) --Bathed in Light buff		
				 and not UnitCastingInfo("player") then
					VAS_Cast(8936,"boss1")	 
					--VAS_WriteToChat("\124cFFFF55FFCast Regrowth Tsulong - HP: " ..Vasa_UnitInfo("boss1")) 
					return true
				end
				
				if members[1].HP > 30 --Prevent raid wipe
				and lowhpmembers < 10 
				and not UnitCastingInfo("player") then 					
					VAS_Cast(5185,"boss1")	 			
					--VAS_WriteToChat("\124cFFFF55FFCast HealingTouch Tsulong - HP: " ..Vasa_UnitInfo("boss1"))	 		
					return true
				end		
		
			end
		end
		
	end

	--Ironbark
	if Vasa_IronbarkCheck then
		if VAS_SpellAvailable(102342) 	  	 
		 and UnitAffectingCombat("player")
		 --and select(2,GetSpellCooldown(102342)) < 2
		 and UnitThreatSituation(members[1].Unit) == 3
		 and IsUsableSpell(102342)
		 and IsSpellInRange(GetSpellInfo(102342),members[1].Unit) == 1 then
			if members[1].HP < Vasa_Ironbark
			and UnitIsPlayer(members[1].Unit)
			then 
				if UnitCastingInfo("player") then
					VAS_SpellStopCasting()
				end
				--VAS_WriteToChat("\124cFFFF55FFIronbark - HP: " ..members[1].HP) 	
				VAS_Cast(102342,members[1].Unit)	
				return true
			end
		end
	end

	--BresOrRes
	if UnitExists("mouseover") 
	and UnitAffectingCombat("player")
	and UnitIsDeadOrGhost("mouseover") 
	and UnitCanCooperate("player", "mouseover")    
	and IsSpellInRange(GetSpellInfo(20484),"mouseover") == 1
	and GetSpellCooldown(20484) == 0 
	and not VAS_IsOutOfSight("mouseover")
	and not UnitCastingInfo("player") 
	and UnitChannelInfo("player") == nil then
		VAS_Cast(20484,"mouseover")	
		return true
	elseif not UnitAffectingCombat("player") 
	and UnitIsConnected("mouseover")
	and UnitCanCooperate("player","mouseover") 	
	and UnitIsDeadOrGhost("mouseover") 
	and not UnitHasIncomingResurrection("mouseover") then		
		if VAS_SpellAvailable(83968) 		
		and not UnitDebuff("mouseover", GetSpellInfo(95223)) ----Mass Resurrection debuff
		and Vasa_CheckLastCast(83968, 2.0)		
		then
			if IsInRaid() then
					group = "raid"
			elseif IsInGroup() then
					group = "party"
			end
			local deadnum = 0
			if group then
				for i = 1, GetNumGroupMembers() do 
					local member = group..i
					if UnitIsDeadOrGhost(member) then
						if not UnitDebuff(member, GetSpellInfo(95223)) then ----Mass Resurrection debuff 
							deadnum = deadnum + 1
						end
					end
				end
			end		
			if deadnum >= 2 
			and not UnitCastingInfo("player") then
				VAS_Cast(83968,nil) --Mass Resurrection	 
				--VAS_WriteToChat("\124cFFFF55FFMouseover - Auto MasRes!")
				return true		
			end
		end
		
		if VAS_SpellAvailable(115178)
		and IsUsableSpell(115178) 		
		and (IsSpellInRange(GetSpellInfo(115178),"mouseover") == 1) 
		and Vasa_CheckLastCast(115178, 2.0)		
		and not VAS_IsOutOfSight("mouseover") 
		and not UnitCastingInfo("player") then 
			VAS_Cast(115178,"mouseover") --Resurrection	 
			--VAS_WriteToChat("\124cFFFF55FFMouseover - Auto Res!")
			return true			
		end			
	end

	--Lifebloom - ToL support
	if Vasa_LifebloomFocusCheck then
		if VAS_SpellAvailable(33763) 
		and IsUsableSpell(33763)
		and UnitExists("focus") 	
		and CanHeal("focus") 
		and IsSpellInRange(GetSpellInfo(33763),"focus") == 1 then 	
			if UnitBuffID("focus", 33763, "PLAYER")
			and (select(7, UnitBuffID("focus", 33763, "PLAYER")) - GetTime() < 2 
			or select(4, UnitBuffID("focus", 33763, "PLAYER")) < 3)
			and not UnitCastingInfo("player") then
				VAS_Cast(33763,"focus")	
				--VAS_WriteToChat("\124cFFFF55FFLifebloom focus 1!")						
				return true				
			elseif not UnitBuffID("focus", 33763, "PLAYER") 
			and not UnitCastingInfo("player") then
				VAS_Cast(33763,"focus")	
				--VAS_WriteToChat("\124cFFFF55FFLifebloom focus 2!")						
				return true									
			end
		end	
	else
		local CLifebloom = false
		
		if not UnitBuffID("player", 106731) then --Tree of Life
			for i=1, #members do	
				if ((UnitBuffID(members[i].Unit, 33763, "PLAYER")
				and select(7, UnitBuffID(members[i].Unit, 33763, "PLAYER")) - GetTime() > 2 
				and select(4, UnitBuffID(members[i].Unit, 33763, "PLAYER")) >= 3
				and UnitThreatSituation(members[i].Unit) == 3)
				or UnitBuffID("boss1", 33763))		
				then
					CLifebloom = true
					break
					--VAS_WriteToChat("\124cFFFF55FFLifebloom on: "..UnitName(members[i].Unit))
				end
			end	
		end
		
		if not CLifebloom 
		and VAS_SpellAvailable(33763) 
		and IsUsableSpell(33763) then
			if #Vasa_Tanks > 0 then
				for i=1, #Vasa_Tanks do
					if UnitThreatSituation(Vasa_Tanks[i].Unit) == 3			 
					 and IsSpellInRange(GetSpellInfo(33763),Vasa_Tanks[i].Unit) == 1 then
						if UnitBuffID(Vasa_Tanks[i].Unit, 33763, "PLAYER")
						and (select(7, UnitBuffID(Vasa_Tanks[i].Unit, 33763, "PLAYER")) - GetTime() < 2 
						or select(4, UnitBuffID(Vasa_Tanks[i].Unit, 33763, "PLAYER")) < 3)
						and not UnitCastingInfo("player") then
							VAS_Cast(33763,Vasa_Tanks[i].Unit)	
							--VAS_WriteToChat("\124cFFFF55FFLifebloom tank!")						
							return true				
						elseif not UnitBuffID(Vasa_Tanks[i].Unit, 33763, "PLAYER") 
						and not UnitCastingInfo("player") then
							VAS_Cast(33763,Vasa_Tanks[i].Unit)	
							--VAS_WriteToChat("\124cFFFF55FFLifebloom tank!")						
							return true									
						end
					end
				end
			end
			
			if UnitThreatSituation(members[1].Unit) == 3	 
			 and members[1].HP < 30 
			 and IsSpellInRange(GetSpellInfo(33763),members[1].Unit) == 1 then
				if UnitBuffID(members[1].Unit, 33763, "PLAYER")
				and (select(7, UnitBuffID(members[1].Unit, 33763, "PLAYER")) - GetTime() < 2 
				or select(4, UnitBuffID(members[1].Unit, 33763, "PLAYER")) < 3)
				and not UnitCastingInfo("player") then
					VAS_Cast(33763,members[1].Unit)	
					--VAS_WriteToChat("\124cFFFF55FFLifebloom high threat member!")		 			
					return true				
				elseif not UnitBuffID(members[1].Unit, 33763, "PLAYER") 
				and not UnitCastingInfo("player") then
					VAS_Cast(33763,members[1].Unit)	
					--VAS_WriteToChat("\124cFFFF55FFLifebloom high threat member!")		 			
					return true							
				end
			end
		end
	end

	--RegrowthTank
	if Vasa_RegrowthTankCheck then
		if VAS_SpellAvailable(8936) 
		 and UnitAffectingCombat("player")	 
		 and IsUsableSpell(8936)
		 and not Vasa_Moving 
		 and not UnitChannelInfo("player")
		 and not UnitCastingInfo("player")	 
		 and not stopcasting then	 
			if #Vasa_Tanks > 0 then
				for i=1, #Vasa_Tanks do
					if UnitThreatSituation(Vasa_Tanks[i].Unit) 	
					 and Vasa_Tanks[i].HP <= Vasa_RegrowthTank 
					 and select(3, Vasa_UnitInfo("player")) > 10 		 
					 and IsSpellInRange(GetSpellInfo(8936),Vasa_Tanks[i].Unit) == 1 then
						--NatureSwiftness 
						if not UnitBuffID("player",132158)
						and VAS_SpellAvailable(132158)
						and select(2,GetTalentRowSelectionInfo(2)) == 4
						--and select(2,GetSpellCooldown(132158)) < 2
						then
							VAS_Cast(132158,"player")	
							--VAS_WriteToChat("\124cFFFF55FFCast NatureSwiftness + RegrowthTank. HP: "..Vasa_Tanks[i].HP)			
						end		
						VAS_Cast(8936,Vasa_Tanks[i].Unit)					
						return true				
					end
				end
			end
		end
	end

	--WildMushroom (TC)
	if Vasa_WildMushroomCheck then
		if not UnitChannelInfo("player") 
		and not UnitCastingInfo("player") 
		and VAS_SpellAvailable(102791) --88747 not work
		then
			local wmbloom = GetTotemInfo(1)
			if not WildMushroomTable then
				WildMushroomTable = { }
			end			
			if AverageHealth(Vasa_WildMushroomLimit) <= Vasa_WildMushroom then
				PRGetDistanceTable((Vasa_WildMushroom+10), 10, (Vasa_WildMushroomLimit-1))	
				PRGetDistanceTablebyHP(Vasa_WildMushroom,(Vasa_WildMushroomLimit-1))					
													
				if IsSpellInRange(GetSpellInfo(88747),prdistancebyhp[1].Unit) 
				and (prdistancebyhp[1].PD >= (Vasa_WildMushroomLimit-1))
				and prdistancebyhp[1].HP <= Vasa_WildMushroom 			
				then				
					if wmbloom then
						if #WildMushroomTable < 1 
						or (#WildMushroomTable > 0
						and WildMushroom_UnitDistance(prdistancebyhp[1].Unit, WildMushroomTable[1].x, WildMushroomTable[1].y)
						and WildMushroom_UnitDistance(prdistancebyhp[1].Unit, WildMushroomTable[1].x, WildMushroomTable[1].y) > 10)
						then
							VAS_Cast(88747,prdistancebyhp[1].Unit)
							WildMushroomUnitLocTable(prdistancebyhp[1].Unit)
							--VAS_WriteToChat("\124cFFFF55FFCast WildMushroom 1 - Name: " ..UnitName(prdistancebyhp[1].Unit).." - HP: "..prdistancebyhp[1].HP.." - PD: "..prdistancebyhp[1].PD) 		
							return true						
						else
							if IsUsableSpell(102791) 
							and VAS_SpellAvailable(102791) then
								VAS_Cast(102791,nil)
								--VAS_WriteToChat("\124cFFFF55FFCast WildMushroomBloom")							
								return true											
							end
						end
					else
						VAS_Cast(88747,prdistancebyhp[1].Unit)
						WildMushroomUnitLocTable(prdistancebyhp[1].Unit)
						--VAS_WriteToChat("\124cFFFF55FFCast WildMushroom 2 - Name: " ..UnitName(prdistancebyhp[1].Unit).." - HP: "..prdistancebyhp[1].HP.." - PD: "..prdistancebyhp[1].PD) 					
						return true
					end
				end		
			elseif (not wmbloom 
			or #WildMushroomTable < 1
			or (#WildMushroomTable > 0
			and (GetTime() > WildMushroomTable[1].WMTime + 30)))
			and UnitAffectingCombat("player")
			then			
				if #Vasa_Tanks > 0 then
					for i=1, #Vasa_Tanks do
						if (UnitThreatSituation(Vasa_Tanks[i].Unit) 						 		 
						or Vasa_Tanks[i].HP < 100)
						and IsSpellInRange(GetSpellInfo(88747),Vasa_Tanks[i].Unit) == 1 then						
							VAS_Cast(88747,Vasa_Tanks[i].Unit)
							WildMushroomUnitLocTable(Vasa_Tanks[i].Unit)						
							--VAS_WriteToChat("\124cFFFF55FFCast WildMushroom on Tanks")			
						end
					end
				elseif members[1].HP < 100
				and IsSpellInRange(GetSpellInfo(88747),members[1].Unit) == 1 then
					VAS_Cast(88747,members[1].Unit)
					WildMushroomUnitLocTable(members[1].Unit)
					--VAS_WriteToChat("\124cFFFF55FFCast WildMushroom on low member")				
				else
					VAS_Cast(88747,nil)
					WildMushroomUnitLocTable("player")
					--VAS_WriteToChat("\124cFFFF55FFCast WildMushroom on myself")				
				end		
			end
		end
	end

	--WildMushroom (TC)
	if Vasa_WildMushroomBloomCheck then	
		local wmbloom = GetTotemInfo(1)
		if wmbloom then
			if (VachiusaRestoDruid_WildMushroomBloom_key and not GetCurrentKeyBoardFocus()) then
				if not UnitChannelInfo("player") 
				and VAS_SpellAvailable(102791)		
				and not UnitCastingInfo("player") 
				--and GetSpellCooldown(102791) == 0		
				then
				  VAS_Cast(102791,nil)		   
				  --VAS_WriteToChat("\124cFFFF55FFLeft Alt Key Down - WildMushroomBloom!")
				  return true
				end
			end		
		end
	end

	--RejuSwiftmendSmart
	if Vasa_SwiftmendCheck then	
		if not RejuSM then
			RejuSM = { }
		end
		
		if VAS_SpellAvailable(774) 									
		and IsUsableSpell(774)					
		--and select(2,GetSpellCooldown(774)) < 2 
		then		
			if #RejuSM < 1 then
				if AverageHealth(Vasa_SwiftmendLimit) <= Vasa_Swiftmend then	
					PRGetDistanceTable((Vasa_Swiftmend+10), 10, (Vasa_SwiftmendLimit-1))	
					PRGetDistanceTablebyHP(Vasa_Swiftmend,(Vasa_SwiftmendLimit-1))		
					if IsSpellInRange(GetSpellInfo(774),prdistancebyhp[1].Unit) 
					and (prdistancebyhp[1].PD >= (Vasa_SwiftmendLimit-1))
					and prdistancebyhp[1].HP <= Vasa_Swiftmend 
					and not UnitCastingInfo("player") then	
						if UnitBuffID(prdistancebyhp[1].Unit, 8936) --WTF??
						and not UnitBuffID(prdistancebyhp[1].Unit, 774) 					
						then						
							table.insert(RejuSM, { RSMUnit = prdistancebyhp[1].Unit, RSMCastTime = GetTime(), RSMHP = prdistancebyhp[1].HP, RSMPD = prdistancebyhp[1].PD  } )					
							VAS_Cast(774,prdistancebyhp[1].Unit)
							--VAS_WriteToChat("\124cFFFF55FFCast Reju then SM - Name: " ..UnitName(prdistancebyhp[1].Unit).." - HP: "..prdistancebyhp[1].HP.." - total around: "..prdistancebyhp[1].PD) 																	
							return true
						else
							table.insert(RejuSM, { RSMUnit = prdistancebyhp[1].Unit, RSMCastTime = GetTime(), RSMHP = prdistancebyhp[1].HP, RSMPD = prdistancebyhp[1].PD  } )					
							--VAS_WriteToChat("\124cFFFF55FFInsert member to SM - Name: " ..UnitName(prdistancebyhp[1].Unit).." - HP: "..prdistancebyhp[1].HP.." - total around: "..prdistancebyhp[1].PD) 																	
							return true								
						end	
					end
				end
			else
				if Vasa_UnitInfo(RejuSM[1].RSMUnit) > 95 and ((GetTime() - RejuSM[1].RSMCastTime) >= 3) then
					--VAS_WriteToChat("\124cFFFF55FFClear RejuSM 1")							
					table.wipe(RejuSM)
					RejuSM = { }					
					return true	
				end
				
				if not UnitBuffID(RejuSM[1].RSMUnit, 8936)
				and not UnitBuffID(RejuSM[1].RSMUnit, 774)
				and IsSpellInRange(GetSpellInfo(774),RejuSM[1].RSMUnit) 
				and not UnitCastingInfo("player") then
					VAS_Cast(774,RejuSM[1].RSMUnit)
					--VAS_WriteToChat("\124cFFFF55FFRenew Reju then SM - Name: " ..UnitName(RejuSM[1].RSMUnit))				
					return true
				end
			end
		end
	end

	--SwiftmendSmart
	if Vasa_SwiftmendCheck 
	and not LLdebuff then	
		if #RejuSM > 0 then			
			if GetSpellCooldown(18562) == 0 then					
				if UnitBuffID(RejuSM[1].RSMUnit, 8936)
				or UnitBuffID(RejuSM[1].RSMUnit, 774) then				
					if IsSpellInRange(GetSpellInfo(18562),RejuSM[1].RSMUnit) 
					then
						if (UnitCastingInfo("player") == GetSpellInfo(50464)) --Nourish					
						then
							VAS_SpellStopCasting()
							--VAS_WriteToChat("\124cFFFF55FFStopCast Nourish for RejuSM ")
						end
						VAS_Cast(18562,RejuSM[1].RSMUnit) 						
						--VAS_WriteToChat("\124cFFFF55FFCast SwiftmendSmart - Name: " ..UnitName(RejuSM[1].RSMUnit))						
						return true						
					end	
				end
			end
				
			if ((GetTime() - RejuSM[1].RSMCastTime) >= 7) then							
				--VAS_WriteToChat("\124cFFFF55FFClear RejuSM 2")							
				table.wipe(RejuSM)
				RejuSM = { }
				return true				
			end
		end
	end

	--Genesis
	if not UnitChannelInfo("player") 
	and not UnitCastingInfo("player") 
	then
		if Vasa_GenesisCheck 
		and GetSpellCooldown(18562) > 0 --only use when Swiftmend on cd
		and AverageHealth(Vasa_GenesisLimit) <= Vasa_Genesis then
			if VAS_SpellAvailable(145518)
			and IsUsableSpell(145518) 
			then
				local GenCount=0
				local RejCount=0
				for i=1, #members do
					if UnitBuffID(members[i].Unit,774,"player")				
					then 	
						RejCount = RejCount + 1	
						if members[i].HP <= Vasa_Genesis then
							GenCount = GenCount + 1
						else
							break --warning, it breaks GenCount also
						end
					end
				end		
				if GenCount >= Vasa_GenesisCount then							
					VAS_Cast(145518,nil)	 
					--VAS_WriteToChat("\124cFFFF55FFCast Genesis - GenCount: " ..GenCount.." - RejCount: "..RejCount) 		
					return true
				end			
			end
		end
	end

	if VAS_SpellAvailable(145518)
	and IsUsableSpell(145518)
	and Vasa_GenesisModCheck 
	and VachiusaRestoDruid_GenesisMod_key and not GetCurrentKeyBoardFocus() then
		VAS_Cast(145518,nil)	 
		--VAS_WriteToChat("\124cFFFF55FFCast Genesis") 
		return true
	end

	--WildGrowth - ToL support
	if Vasa_WildGrowthCheck then
		if VAS_SpellAvailable(48438) 
		and IsUsableSpell(48438)			
		--and select(2,GetSpellCooldown(48438)) < 2 
		and not LLdebuff then
			if AverageHealth(Vasa_WildGrowthLimit) <= Vasa_WildGrowth then
				PRGetDistanceTable((Vasa_WildGrowth+5), 30, (Vasa_WildGrowthLimit-1))	
				PRGetDistanceTablebyHP(Vasa_WildGrowth,(Vasa_WildGrowthLimit-1))					
													
				if IsSpellInRange(GetSpellInfo(48438),prdistancebyhp[1].Unit) 
				and (prdistancebyhp[1].PD >= (Vasa_WildGrowthLimit-1))
				and prdistancebyhp[1].HP <= Vasa_WildGrowth 
				and not UnitCastingInfo("player") then					 	
					VAS_Cast(48438,prdistancebyhp[1].Unit)
					--VAS_WriteToChat("\124cFFFF55FFCast WildGrowth - Name: " ..UnitName(prdistancebyhp[1].Unit).." - HP: "..prdistancebyhp[1].HP.." - PD: "..prdistancebyhp[1].PD) 					
					return true
				end
										
			end		
		end
	end

	--NatureSwiftness 
	if Vasa_NatureSwiftnessCheck then	
		if not UnitBuffID("player",132158)
		and VAS_SpellAvailable(132158)
		and select(2,GetTalentRowSelectionInfo(2)) == 4
		--and select(2,GetSpellCooldown(132158)) < 2
		then
			if members[1].HP <= Vasa_NatureSwiftness 
			and not UnitCastingInfo("player") then
				VAS_Cast(132158,"player")
				return true
			end
		end
	end

	--Regrowth - duration automatically refreshes to 6 sec each time Regrowth heals targets at or below 50% health.
	--ToL support
	if Vasa_RegrowthCheck then	
		if VAS_SpellAvailable(8936) 
		 and IsSpellInRange(GetSpellInfo(8936),members[1].Unit) == 1
		 and IsUsableSpell(8936)	 
		 and not Vasa_Moving 
		 and not stopcasting then	 	
			if members[1].HP < Vasa_Regrowth and select(3, Vasa_UnitInfo("player")) > 20 
			and not UnitCastingInfo("player") then	
				--NatureSwiftness 
				if not UnitBuffID("player",132158)
				and VAS_SpellAvailable(132158)
				and select(2,GetTalentRowSelectionInfo(2)) == 4
				--and select(2,GetSpellCooldown(132158)) < 2
				then
					VAS_Cast(132158,"player")	
					--VAS_WriteToChat("\124cFFFF55FFCast NatureSwiftness. HP: "..members[1].HP)			
				end		
				VAS_Cast(8936,members[1].Unit)					
				return true
			elseif UnitBuffID("player", 16870) 
			and Vasa_CheckLastCast(8936, 0.5)
			and members[1].HP <= Vasa_OmenRegrowth 
			and not UnitCastingInfo("player") then --Omen of Clarity buff cost no mana		
				VAS_Cast(8936,members[1].Unit)					
				--VAS_WriteToChat("\124cFFFF55FFCast OmenRegrowth. HP: "..members[1].HP)			
				return true		
			end
		end
	end

	--HealingTouch
	if Vasa_HealingTouchCheck then
		if VAS_SpellAvailable(5185) 
		and IsSpellInRange(GetSpellInfo(5185),members[1].Unit) == 1
		and IsUsableSpell(5185) 	 
		and not Vasa_Moving 
		and not UnitCastingInfo("player")
		and not stopcasting then
			if members[1].HP < Vasa_HealingTouch 
			and select(3, Vasa_UnitInfo("player")) > 20 then	
				--NatureSwiftness 
				if not UnitBuffID("player",132158)
				and VAS_SpellAvailable(132158)
				and select(2,GetTalentRowSelectionInfo(2)) == 4
				--and select(2,GetSpellCooldown(132158)) < 2
				then				
					VAS_Cast(132158,"player")					
					--VAS_WriteToChat("\124cFFFF55FFCast NatureSwiftness. HP: "..members[1].HP)
				end				
				VAS_Cast(5185,members[1].Unit)	
				return true
			elseif UnitBuffID("player", 16870) and members[1].HP <= Vasa_OmenHealingTouch then --Omen of Clarity buff cost no mana
				VAS_Cast(5185,members[1].Unit)	
				return true			
			end
			local SMName, _, _, SMcount, _, _, SMexpirationTime = UnitBuffID("player", 144871) --Sage Mender - 2p bonus tier 16
			if SMName and SMcount and SMexpirationTime then --SM stack
				if (tonumber(SMexpirationTime) and ((tonumber(SMexpirationTime) - GetTime()) <= 2))
				or (tonumber(SMcount) and tonumber(SMcount) >= 5 and members[1].HP <= Vasa_OmenHealingTouch) then
					--VAS_WriteToChat("\124cFFFF55FFCast HealingTouch before Sage Mender expired - Name: " ..UnitName(members[1].Unit))
					VAS_Cast(5185,members[1].Unit)	
					return true
				end
			end		
		end
	end

	if Vasa_RejuvenationTankCheck then
		if VAS_SpellAvailable(774) 	
		and IsUsableSpell(774) 
		and Vasa_CheckLastCast(774, 2.0) then
			if #Vasa_Tanks > 0 then
				for i=1, #Vasa_Tanks do
					if UnitThreatSituation(Vasa_Tanks[i].Unit)
					 and select(3, Vasa_UnitInfo("player")) > 15
					 and Vasa_Tanks[i].HP <= Vasa_RejuvenationTank
					 and not UnitCastingInfo("player") 
					 and IsSpellInRange(GetSpellInfo(774),Vasa_Tanks[i].Unit) == 1 then
						if UnitBuffID(Vasa_Tanks[i].Unit, 774, "PLAYER") then
							if (select(7, UnitBuffID(Vasa_Tanks[i].Unit, 774, "PLAYER")) - GetTime() <= 2) 						
							then
								VAS_Cast(774,Vasa_Tanks[i].Unit)					
								--VAS_WriteToChat("\124cFFFF55FFRejuvenation soon expired on tank!")	
								return true
							end
						else
							VAS_Cast(774,Vasa_Tanks[i].Unit)
							--VAS_WriteToChat("\124cFFFF55FFRejuvenation tank!")	
							return true
						end				
					end
				end
			end
				
			if select(3, Vasa_UnitInfo("player")) > 20
			and not UnitBuffID(members[1].Unit, 774)
			and members[1].HP < Vasa_Rejuvenation
			and IsSpellInRange(GetSpellInfo(774),members[1].Unit) == 1 
			and not UnitCastingInfo("player") then
				VAS_Cast(774,members[1].Unit)
				--VAS_WriteToChat("\124cFFFF55FFRejuvenation high threat member!")	
				return true
			end	
		end
	end

	if Vasa_NourishCheck then
		if VAS_SpellAvailable(50464) 	 
		 and IsUsableSpell(50464) 
		 and not Vasa_Moving 	 
		 and (UnitBuffID(members[1].Unit, 774, "PLAYER") --Rejuvenation
		 or UnitBuffID(members[1].Unit, 8936, "PLAYER") --Regrowth
		 or UnitBuffID(members[1].Unit, 33763, "PLAYER") --Lifebloom
		 or UnitBuffID(members[1].Unit, 48438, "PLAYER")) --Wild Growth
		 and IsSpellInRange(GetSpellInfo(50464),members[1].Unit) == 1 
		 and not stopcasting then				
			if members[1].HP <= Vasa_Nourish
			and lowhpmembers < 3 
			and not UnitCastingInfo("player") then
				VAS_Cast(50464,members[1].Unit)									
				--VAS_WriteToChat("\124cFFFF55FFCasting Nourish - HP: " ..members[1].HP) 
				return true
			elseif not UnitBuffID("player", 100977) --Harmony 77495
			and (members[1].HP < (Vasa_Nourish+10)) 
			and not UnitCastingInfo("player") then
				VAS_Cast(50464,members[1].Unit)									
				--VAS_WriteToChat("\124cFFFF55FFCasting Nourish for Harmony - HP: " ..members[1].HP) 
				return true				
			elseif UnitBuffID("player", 100977) --Harmony 77495
			and (members[1].HP < (Vasa_Nourish+10)) then
				if (select(7, UnitBuffID("player", 100977)) - GetTime() <= 2) 
				and not UnitCastingInfo("player") then
					VAS_Cast(50464,members[1].Unit)					
					--VAS_WriteToChat("\124cFFFF55FFCasting Nourish for Harmony - HP: " ..members[1].HP) 
					return true							
				end		
			end
		end
	end

	--Moonfire
	if (Vasa_DPSCheck and members[1].HP >= Vasa_DPS)
	or UnitBuffID("player", 124974) --Nature's Vigil
	or UnitBuffID("player", 108288) then --HoTW
		if UnitAffectingCombat("player")		
		and not stopdps
		and select(3, Vasa_UnitInfo("player")) >= 80
		and VAS_SpellAvailable(8921) 
		and UnitExists("target")
		and IsSpellInRange(GetSpellInfo(8921),"target") == 1
		--and GetSpellCooldown(8921) == 0
		and IsUsableSpell(8921)
		and not VAS_IsOutOfSight("target")
		and not UnitIsDeadOrGhost("target")	
		and not LineOfSight("target")	
		and UnitCanAttack("player", "target") then
			local MF,_,_,_,_,_,MFtimer = UnitDebuffID("target",8921,"PLAYER")
			if MF == nil 
			and not UnitCastingInfo("player") then
				VAS_Cast(8921,"target")	
				return true 
			end
		end
	end

	--Moonfire
	if Vasa_DPSCheck 
	and (members[1].HP >= Vasa_DPS
	or UnitBuffID("player", 124974) --Nature's Vigil
	or UnitBuffID("player", 108288)) then --HoTW
		if UnitAffectingCombat("player")	
		and not stopdps
		and select(3, Vasa_UnitInfo("player")) >= 80
		and VAS_SpellAvailable(5176) 
		and UnitExists("target")
		and IsSpellInRange(GetSpellInfo(5176),"target") == 1
		--and GetSpellCooldown(5176) == 0
		and IsUsableSpell(5176)
		and not VAS_IsOutOfSight("target")
		and not UnitCastingInfo("player") 
		and not UnitIsDeadOrGhost("target")
		and not LineOfSight("target")
		and UnitCanAttack("player", "target") 
		and not stopcasting then
			VAS_Cast(5176,"target")
			return true 
		end
	end

	--Symbiosis
	if Vasa_SymbiosisCheck then
		if VAS_SpellAvailable(110309)
		--and select(2,GetSpellCooldown(110309)) < 2
		and IsUsableSpell(110309) 	
		and not UnitBuffID("player", 110309)
		and not UnitAffectingCombat("player") then
													
		    for i=1,40 do
				local unitCheck = "raid"..i
			    if UnitExists(unitCheck) and UnitIsPlayer(unitCheck) then
				local _, unitClass = UnitClass(unitCheck)
				if unitClass == "SHAMAN" and not UnitBuffID(unitCheck, 110309) then		        	
					SymSHAMAN = unitCheck
				    break
				end
				
				if unitClass == "PALADIN" and not UnitBuffID(unitCheck, 110309) then		        	
					SymPALADIN = unitCheck
				end
				
				if unitClass == "DEATHKNIGHT" and not UnitBuffID(unitCheck, 110309) then		        	
					SymDEATHKNIGHT = unitCheck
				end
				
				if unitClass == "HUNTER" and not UnitBuffID(unitCheck, 110309) then		        	
					SymHUNTER = unitCheck
				end
				
				if unitClass == "MAGE" and not UnitBuffID(unitCheck, 110309) then		        	
					SymMAGE = unitCheck		           
				end		        
			    end
			end
			
			if Vasa_CheckLastCast(110309, 5) then		
				if UnitExists(SymSHAMAN) then			
					if IsSpellInRange(GetSpellInfo(110309),SymSHAMAN) == 1
					and CanHeal(SymSHAMAN) 
					and not UnitCastingInfo("player") then
						VAS_TargetUnit(SymSHAMAN)
				    VAS_Cast(110309,SymSHAMAN)
						--VAS_WriteToChat("\124cFFFF55FFCasting SymSHAMAN - Name: " ..UnitName(SymSHAMAN)) 
						return true
					end
				elseif UnitExists(SymPALADIN) and not SymSHAMAN then
					if IsSpellInRange(GetSpellInfo(110309),SymPALADIN) == 1
					and CanHeal(SymPALADIN) 
					and not UnitCastingInfo("player") then	
						VAS_TargetUnit(SymPALADIN)
						VAS_Cast(110309,SymPALADIN)
						--VAS_WriteToChat("\124cFFFF55FFCasting SymPALADIN - Name: " ..UnitName(SymPALADIN)) 
						return true		
					end
				elseif UnitExists(SymDEATHKNIGHT) and not SymSHAMAN then
					if IsSpellInRange(GetSpellInfo(110309),SymDEATHKNIGHT) == 1
					and CanHeal(SymDEATHKNIGHT) 
					and not UnitCastingInfo("player") then	
						VAS_TargetUnit(SymDEATHKNIGHT)
						VAS_Cast(110309,SymDEATHKNIGHT)
						--VAS_WriteToChat("\124cFFFF55FFCasting SymDEATHKNIGHT - Name: " ..UnitName(SymDEATHKNIGHT)) 
						return true		
					end
				elseif UnitExists(SymHUNTER) and not SymSHAMAN then
					if IsSpellInRange(GetSpellInfo(110309),SymHUNTER) == 1
					and CanHeal(SymHUNTER)	
					and not UnitCastingInfo("player") then	
						VAS_TargetUnit(SymHUNTER)
						VAS_Cast(110309,SymHUNTER)
						--VAS_WriteToChat("\124cFFFF55FFCasting SymHUNTER - Name: " ..UnitName(SymHUNTER)) 
						return true		
					end
				elseif UnitExists(SymMAGE) and not SymSHAMAN then
					if IsSpellInRange(GetSpellInfo(110309),SymMAGE) == 1
					and CanHeal(SymMAGE) 
					and not UnitCastingInfo("player") then		
						VAS_TargetUnit(SymMAGE)
						VAS_Cast(110309,SymMAGE)
						--VAS_WriteToChat("\124cFFFF55FFCasting SymMAGE - Name: " ..UnitName(SymMAGE)) 
						return true
					end
				end		
			end
			
		end
	end

	if PQI_VachiusaGeneral_RotationEngine_value == 4 then
		raidfu = nil
		vicon = nil
		CompactRaidFrameContainer_ApplyToFrames(CompactRaidFrameContainer, "normal", VAS_UpdateIcon)
	elseif PQI_VachiusaGeneral_RotationEngine_value == 7 and not UnitCastingInfo("player") then
		raidfu = nil
		vicon = nil
		HealBot_OnEvent_VachiusaUpdate(vicon,raidfu)
	elseif PQI_VachiusaGeneral_RotationEngine_value == 8 and not UnitCastingInfo("player") then
		raidfu = nil
		vicon = nil
		ElvUF_OnEvent_VachiusaUpdate(vicon,raidfu)	
	end
	return true
end